package com.pajk.user.model.enums;

/**
 * Created by haomin on 3/25/14.
 * modify by peide.zhang on 4/28/14.
 */
public enum RelationType{
    FATHER(0,"父亲"), MOTHER(1,"母亲"), FATHER_OF_HUSBAND(2,"公公"), MOTHER_OF_HUSBAND(3,"婆婆"), FATHER_OF_WIFE(4,"岳父"),
    MOTHER_OF_WIFE(5,"岳母"), SON(6,"儿子"), DAUGHTER(7,"女儿"), HUSBAND(8,"老公"), WIFE(9,"老婆"), OTHER(10,"其他"),RELATIVE(11,"亲友");

    private int value;
    private String desc;

    private RelationType(int value,String desc){
        this.value = value;
        this.desc=desc;
    }

    public int value() {
        return this.value;
    }
    public String desc(){
        return this.desc;
    }

    public static RelationType findRelationTypeEnum(int vlaue) {
        for (RelationType relationTypeEnum : RelationType.class.getEnumConstants()) {
            if (relationTypeEnum.value()==vlaue)  {
                return relationTypeEnum;
            }
        }
        return null;
    }
}

